package cn.iocoder.yudao.module.pay.dal.mysql.paycollectinfo;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pay.controller.admin.collect.vo.PayCollectInfoPageReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.paycollectinfo.PayCollectInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 收款账户信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PayCollectInfoMapper extends BaseMapperX<PayCollectInfoDO> {

    default PageResult<PayCollectInfoDO> selectPage(PayCollectInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayCollectInfoDO>()
                .eqIfPresent(PayCollectInfoDO::getType, reqVO.getType())
                .eqIfPresent(PayCollectInfoDO::getAccountNo, reqVO.getAccountNo())
                .likeIfPresent(PayCollectInfoDO::getAccountName, reqVO.getAccountName())
                .eqIfPresent(PayCollectInfoDO::getBankAddr, reqVO.getBankAddr())
                .likeIfPresent(PayCollectInfoDO::getBankName, reqVO.getBankName())
                .eqIfPresent(PayCollectInfoDO::getAccountQrUrl, reqVO.getAccountQrUrl())
                .eqIfPresent(PayCollectInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PayCollectInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayCollectInfoDO::getId));
    }

}